import torchvision
import torch

# vgg16 = torchvision.models.vgg16(pretrained=False) # 已经不使用 pretrained=False 参数 改为weights
vgg16 = torchvision.models.vgg16(weights=None)
# 保存模型1
torch.save(vgg16, "./202410/模型的保存与加载/vgg16.pth")
# print(vgg16)

# 保存模型2 
torch.save(vgg16.state_dict(), "./202410/模型的保存与加载/vgg16_2.pth")
